#include <QObject>
#include "gui_utils.h"

QString GUIUtils::propToString(TIP prop)
{
    switch (prop) {
    case TIP::PID:
        return QObject::tr("ID");
    case TIP::PPID:
        return QObject::tr("Parent ID");
    case TIP::NAME:
        return QObject::tr("Name");
    case TIP::USERNAME:
        return QObject::tr("User Name");
    case TIP::STATE:
        return QObject::tr("State");
    case TIP::VM_SIZE:
        return QObject::tr("Mem Size");
    case TIP::VM_RESIDENT:
        return QObject::tr("Mem Resident");
    case TIP::VM_SHARED:
        return QObject::tr("Mem Shared");
    case TIP::VM_PRIVATE:
        return QObject::tr("Mem Private");
    case TIP::CPU_USAGE:
        return QString("%CPU");
    case TIP::CPU_TIME:
        return QObject::tr("CPU Time");
    case TIP::START_TIME:
        return QObject::tr("Start Time");
    case TIP::NICE:
        return QString("Nice");
    case TIP::CMD:
        return QObject::tr("CMD");

    default:
        return QObject::tr("Unknown Property");
    }
}

QString GUIUtils::stateToString(TaskState state)
{
    switch (state)
    {
    case TaskState::R:
        return QObject::tr("R");
    case TaskState::S:
        return QObject::tr("S");
    case TaskState::D:
        return QObject::tr("D");
    case TaskState::Z:
        return QObject::tr("Z");
    case TaskState::T:
        return QObject::tr("T");
    default:
        return QObject::tr("x");
    }
}
